// Shared router configuration to avoid duplication
import MainLayout from './layouts/MainLayout.vue';

// Vocabulary components
import VocabularySearch from './components/VocabularySearch.vue';
import VocabularyList from './components/VocabularyList.vue';
import VocabularyPractice from './components/VocabularyPractice.vue';
import QueryHistory from './components/QueryHistory.vue';
import LearningProgress from './components/LearningProgress.vue';

// Course components
import CourseList from './components/CourseList.vue';

const routes = [
  {
    path: '/',
    component: MainLayout,
    children: [
      // Vocabulary routes
      {
        path: '/vocabulary/search',
        component: VocabularySearch,
      },
      {
        path: '/vocabulary/list',
        component: VocabularyList,
      },
      {
        path: '/vocabulary/practice',
        component: VocabularyPractice,
      },
      {
        path: '/vocabulary/history',
        component: QueryHistory,
      },
      {
        path: '/vocabulary/progress',
        component: LearningProgress,
      },

      // Course routes
      {
        path: '/courses/list',
        component: CourseList,
      },

      // Default route
      {
        path: '/:pathMatch(.*)*',
        redirect: '/vocabulary/search',
      },
    ],
  },
];

export default routes;